import os

from django.test import TestCase

# Create your tests here.
if __name__ == '__main__':
    # 先导入一句话
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'BookSystem.settings')

    # 启动Django
    import django

    django.setup()

    from book.models import Book
    from author.models import Author

    book_obj=Book.objects.get(pk=2)
    print(book_obj)
    author_obj=Author.objects.get(pk=5)
    print(author_obj)
    # book_obj.author.set([author_obj])
